//
//  LSHUICommonClass.m
//
//  Created by an on 15/9/15.
//  Copyright (c) 2015年 yesmywine. All rights reserved.
//

#import "JMUICommonClass.h"

@implementation JMUICommonClass


#pragma UILabel部分

+(VerticallyAlignedLabel *)creatLabelFromText:(NSString *)text textAlignment:(NSTextAlignment)textAlignment verticalAlignment:(VerticalAlignment)verticalAlignment textColor:(UIColor *)color numberOfLines:(NSInteger)lines{

    VerticallyAlignedLabel *label=[[VerticallyAlignedLabel alloc]init];
    label.text=text;
    label.textAlignment=textAlignment;
    label.verticalAlignment=verticalAlignment;
    label.textColor=color;
    label.numberOfLines=lines;
    return label;
    
}





#pragma  UIButton部分

+(UIButton *)creatButtonFromFrame:(CGRect)frame buttonTitle:(NSString *)title buttonTitleColor:(UIColor *)color buttonFont:(UIFont *)font{
    
    UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom];
    [button setFrame:frame];
    [button setTitle:title forState:UIControlStateNormal];
    [button setTitleColor:color forState:UIControlStateNormal];
    button.titleLabel.font=font;
    
    return button;
}

+(UIButton *)creatButtonFromButtonTitle:(NSString *)title buttonTitleColor:(UIColor *)color buttonFont:(UIFont *)font backgroundColor:(UIColor *)backgroundcolor{
    
    return  [self creatButtonFromButtonTitle:title buttonTitleColor:color buttonFont:font backgroundColor:backgroundcolor buttonCornerRadius:0.0 buttonBorderWidth:0.0 buttonBorderColor:[UIColor clearColor].CGColor];
}

+(UIButton *)creatButtonFromButtonTitle:(NSString *)title buttonTitleColor:(UIColor *)color buttonFont:(UIFont *)font backgroundColor:(UIColor *)backgroundcolor buttonCornerRadius:(CGFloat)cornerRadius buttonBorderWidth:(CGFloat)borderWidth buttonBorderColor:(CGColorRef)borderColor{
    
    UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom];
    [button setTitle:title forState:UIControlStateNormal];
    [button setTitleColor:color forState:UIControlStateNormal];
    button.titleLabel.font=font;
    button.backgroundColor=backgroundcolor;
    button.layer.cornerRadius=cornerRadius;
    button.layer.masksToBounds=YES;
    button.layer.borderWidth=borderWidth;
    button.layer.borderColor=borderColor;
    return button;
}




@end
